package com.yonyougov.devops.cruxcisupport.app;

import com.yonyougov.devops.cruxcisupport.util.CruxDevOpsIdGenerator;
import com.yonyougov.devops.fwc.core.entity.BasicEntity;
import com.yonyougov.devops.fwc.core.id.IdGenerator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigInteger;

/***
 * t_app
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class  AppEntity extends BasicEntity implements Serializable {

    private static final long serialVersionUID = -2201277108106870179L;
    /***
     * 主键
     */
    private BigInteger id;

    /***
     * 应用名称
     */
    private String app;

    /***
     * 服务根路径
     */
    private String contextPath;

    /***
     * 描述
     */
    private String remark;

    /***
     * 序列号
     */
    private String serialNumber;

    /***
     * 健康检查
     */
    private String healthCheckPath;

    /**
     * 是否需要对面暴露端口
     */
    private Boolean exposePort;

    /**
     * 领域
     */
    private String domain;

    /**
     * 普罗米修斯监控路径
     */
    private String actuatorUrl;


    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }


    public Boolean getExposePort() {
        return exposePort;
    }

    public void setExposePort(Boolean exposePort) {
        this.exposePort = exposePort;
    }


    public Integer getHealthCheckPort() {
        return healthCheckPort;
    }

    public void setHealthCheckPort(Integer healthCheckPort) {
        this.healthCheckPort = healthCheckPort;
    }

    /***
     * 健康检查端口
     */
    private Integer healthCheckPort;

    /***
     * 获取主键
     *
     * @return 获取主键
     */
    public BigInteger getId() {
        return id;
    }

    /***
     * 设置主键
     *
     * @param id 主键
     */
    public void setId(BigInteger id) {
        this.id = id;
    }

    /***
     * 获取应用名称
     *
     * @return 获取应用名称
     */
    public String getApp() {
        return app;
    }

    /***
     * 设置应用名称
     *
     * @param app 应用名称
     */
    public void setApp(String app) {
        this.app = app;
    }

    /***
     * 获取服务根路径
     *
     * @return 获取服务根路径
     */
    public String getContextPath() {
        return contextPath;
    }

    /***
     * 设置服务根路径
     *
     * @param contextPath 服务根路径
     */
    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    /***
     * 获取描述
     *
     * @return 获取描述
     */
    public String getRemark() {
        return remark;
    }

    /***
     * 设置描述
     *
     * @param remark 描述
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /***
     * 获取序列号
     *
     * @return 获取序列号
     */
    public String getSerialNumber() {
        return serialNumber;
    }

    /***
     * 设置序列号
     *
     * @param serialNumber 序列号
     */
    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getHealthCheckPath() {
        return healthCheckPath;
    }

    public void setHealthCheckPath(String healthCheckPath) {
        this.healthCheckPath = healthCheckPath;
    }

    public String getActuatorUrl() {
        return actuatorUrl;
    }

    public void setActuatorUrl(String actuatorUrl) {
        this.actuatorUrl = actuatorUrl;
    }
    @Override
    public String toString() {
        return "AppEntity{" +
                "id=" + id +
                ", app='" + app + '\'' +
                ", contextPath='" + contextPath + '\'' +
                ", remark='" + remark + '\'' +
                ", serialNumber='" + serialNumber + '\'' +
                ", healthCheckPath='" + healthCheckPath + '\'' +
                ", actuatorUrl='" + actuatorUrl + '\'' +
                '}';
    }

    //<!--用户自定义代码开始-->
    public IdGenerator idGenerator() {
        return new CruxDevOpsIdGenerator();
    }
    //<!--用户自定义代码结束-->
}
